<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;
use Illuminate\Support\Facades\DB;

class CreateAppsTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('apps', function (Blueprint $table) {
            $table->increments('id')->comment('自增长');
            $table->string('app_id',60)->comment('appid');
            $table->string('app_secret',100)->comment('密钥');
            $table->string('app_name',200)->comment('app名称');
            $table->text('app_desc')->nullable()->comment('描述');
            $table->tinyInteger('status')->default(0)->comment('生效状态');
            $table->timestamps();
            $table->primary('id');
            $table->unique('app_id');
            $table->index('status');
            $table->engine = 'InnoDB';
            $table->comment = '应用表';
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('apps');
    }
}
